package com.etennis.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.etennis.mapper.view.ClubStatMapper;
import com.etennis.pojos.ResponseResult;
import com.etennis.pojos.view.ClubStats;
import com.etennis.util.SecurityUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: ETennis
 * @ClassName: ClubController
 * @description:
 * @author: kai
 * @create: 2024-10-25 15:59
 */
@RestController
@RequestMapping("/web/club")
@Slf4j
@Api(tags = "网页端-俱乐部接口")
public class ClubController {
    @Autowired
    private ClubStatMapper clubStatMapper;
    @GetMapping("/getDetails")
    public ResponseResult<ClubStats> getClubInfo(){
        LambdaQueryWrapper<ClubStats> queryWrapper=new LambdaQueryWrapper();
        queryWrapper.eq(ClubStats::getId, SecurityUtils.getLoginClubId());
        ClubStats clubStat = clubStatMapper.selectOne(queryWrapper);
        return ResponseResult.okResult(clubStat);
    }
}
